home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 106
/
Vol 106.iso
/
games
/
toms_tra.swf
/
scripts
/
frame_5
/
DoAction.as
Wrap
Text File
|
2010-04-12
|
2KB
|
108 lines
function navigate(lab)
{
gotoAndStop(lab);
}
getURL("FSCommand:showmenu",false);
getURL("FSCommand:allowscale",false);
navigate("loading");
MovieClip.prototype.makeSound = function(snd, vol, loops, effect)
{
if(this.playing_sound == null)
{
this.playing_sound = new Sound();
this.playing_sound.attachSound(snd);
var thesound = this.playing_sound;
this.playing_sound.onSoundComplete = function()
{
delete thesound;
};
}
if(effect == null)
{
this.playing_sound.setVolume(vol);
this.playing_sound.start(0,loops);
}
else
{
if(effect == "stop")
{
var thesound = this.playing_sound;
thesound.stop();
delete thesound;
}
if(effect == "fadein")
{
}
if(effect == "fadeout")
{
}
}
};
MovieClip.prototype.setToColor = function(col)
{
if(col == "none")
{
col = {ra:100,ga:100,ba:100,rb:0,gb:0,bb:0,aa:100,ab:0};
}
this.curCol = new Color(this);
this.curCol.setTransform(col);
};
MovieClip.prototype.getCordsDepth = function(r, c)
{
var _loc1_ = 0;
i = 0;
while(i <= r)
{
_loc1_ += i;
i++;
}
if(c != 0)
{
var _loc2_ = r + 2;
i = 1;
while(i <= c)
{
_loc1_ += _loc2_;
_loc2_ = _loc2_ + 1;
i++;
}
}
return _loc1_;
};
MovieClip.prototype.convertCords = function(cords)
{
var _loc2_ = 21;
var _loc3_ = 61.9;
if(cords.col != null)
{
var _loc4_ = new Object();
_loc4_.x = cords.row * (_loc3_ / -2) + cords.col * (_loc3_ / 2);
_loc4_.y = cords.row * (_loc2_ / 2) + cords.col * (_loc2_ / 2);
return _loc4_;
}
var _loc5_ = new Object();
_loc5_.row = (cords.y / (_loc2_ / -2) + cords.x / (_loc3_ / 2)) / -2;
_loc5_.col = (cords.x / (_loc3_ / 2) + cords.y / (_loc2_ / 2)) / 2;
return _loc5_;
};
MovieClip.prototype.fadeTo = function(alph, spd)
{
if(alph == 0)
{
spd = 2;
}
else
{
spd = 7;
}
this.onEnterFrame = function()
{
this._alpha += (alph - this._alpha) / spd;
if(Math.abs(alph - this._alpha) < 2)
{
this._alpha = alph;
this.onEnterFrame = null;
}
};
};